## API Report File for "@backstage/plugin-catalog-backend-module-msgraph"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { CatalogProcessor } from '@backstage/plugin-catalog-node';
import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node';
import { Config } from '@backstage/config';
import { EntityProvider } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { GroupEntity } from '@backstage/catalog-model';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { Logger } from 'winston';
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { Response as Response_2 } from 'node-fetch';
import { TaskRunner } from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { TokenCredential } from '@azure/identity';
import { UserEntity } from '@backstage/catalog-model';

// @public
export function defaultGroupTransformer(
  group: MicrosoftGraph.Group,
  groupPhoto?: string,
): Promise<GroupEntity | undefined>;

// @public
export function defaultOrganizationTransformer(
  organization: MicrosoftGraph.Organization,
): Promise<GroupEntity | undefined>;

// @public
export function defaultUserTransformer(
  user: MicrosoftGraph.User,
  userPhoto?: string,
): Promise<UserEntity | undefined>;

// @public
export type GroupMember =
  | (MicrosoftGraph.Group & {
      '@odata.type': '#microsoft.graph.user';
    })
  | (MicrosoftGraph.User & {
      '@odata.type': '#microsoft.graph.group';
    });

// @public
export type GroupTransformer = (
  group: MicrosoftGraph.Group,
  groupPhoto?: string,
) => Promise<GroupEntity | undefined>;

// @public
export const MICROSOFT_EMAIL_ANNOTATION = 'microsoft.com/email';

// @public
export const MICROSOFT_GRAPH_GROUP_ID_ANNOTATION =
  'graph.microsoft.com/group-id';

// @public
export const MICROSOFT_GRAPH_TENANT_ID_ANNOTATION =
  'graph.microsoft.com/tenant-id';

// @public
export const MICROSOFT_GRAPH_USER_ID_ANNOTATION = 'graph.microsoft.com/user-id';

// @public
export class MicrosoftGraphClient {
  constructor(baseUrl: string, tokenCredential: TokenCredential);
  static create(config: MicrosoftGraphProviderConfig): MicrosoftGraphClient;
  getGroupMembers(
    groupId: string,
    query?: ODataQuery,
    queryMode?: 'basic' | 'advanced',
  ): AsyncIterable<GroupMember>;
  // (undocumented)
  getGroupPhoto(groupId: string, sizeId?: string): Promise<string | undefined>;
  getGroupPhotoWithSizeLimit(
    groupId: string,
    maxSize: number,
  ): Promise<string | undefined>;
  getGroups(
    query?: ODataQuery,
    queryMode?: 'basic' | 'advanced',
  ): AsyncIterable<MicrosoftGraph.Group>;
  getGroupUserMembers(
    groupId: string,
    query?: ODataQuery,
    queryMode?: 'basic' | 'advanced',
  ): AsyncIterable<MicrosoftGraph.User>;
  getOrganization(tenantId: string): Promise<MicrosoftGraph.Organization>;
  // (undocumented)
  getUserPhoto(userId: string, sizeId?: string): Promise<string | undefined>;
  getUserPhotoWithSizeLimit(
    userId: string,
    maxSize: number,
  ): Promise<string | undefined>;
  getUsers(
    query?: ODataQuery,
    queryMode?: 'basic' | 'advanced',
  ): AsyncIterable<MicrosoftGraph.User>;
  requestApi(
    path: string,
    query?: ODataQuery,
    headers?: Record<string, string>,
  ): Promise<Response_2>;
  requestCollection<T>(
    path: string,
    query?: ODataQuery,
    queryMode?: 'basic' | 'advanced',
  ): AsyncIterable<T>;
  requestRaw(
    url: string,
    headers?: Record<string, string>,
  ): Promise<Response_2>;
}

// @public
export class MicrosoftGraphOrgEntityProvider implements EntityProvider {
  constructor(options: {
    id: string;
    provider: MicrosoftGraphProviderConfig;
    logger: Logger;
    userTransformer?: UserTransformer;
    groupTransformer?: GroupTransformer;
    organizationTransformer?: OrganizationTransformer;
  });
  // (undocumented)
  connect(connection: EntityProviderConnection): Promise<void>;
  // (undocumented)
  static fromConfig(
    configRoot: Config,
    options: MicrosoftGraphOrgEntityProviderOptions,
  ): MicrosoftGraphOrgEntityProvider[];
  // (undocumented)
  getProviderName(): string;
  read(options?: { logger?: Logger }): Promise<void>;
}

// @public @deprecated
export interface MicrosoftGraphOrgEntityProviderLegacyOptions {
  groupTransformer?: GroupTransformer;
  id: string;
  logger: Logger;
  organizationTransformer?: OrganizationTransformer;
  schedule: 'manual' | TaskRunner;
  target: string;
  userTransformer?: UserTransformer;
}

// @public
export type MicrosoftGraphOrgEntityProviderOptions =
  | MicrosoftGraphOrgEntityProviderLegacyOptions
  | {
      logger: Logger;
      schedule?: 'manual' | TaskRunner;
      scheduler?: PluginTaskScheduler;
      userTransformer?: UserTransformer | Record<string, UserTransformer>;
      groupTransformer?: GroupTransformer | Record<string, GroupTransformer>;
      organizationTransformer?:
        | OrganizationTransformer
        | Record<string, OrganizationTransformer>;
    };

// @public @deprecated
export class MicrosoftGraphOrgReaderProcessor implements CatalogProcessor {
  constructor(options: {
    providers: MicrosoftGraphProviderConfig[];
    logger: Logger;
    userTransformer?: UserTransformer;
    groupTransformer?: GroupTransformer;
    organizationTransformer?: OrganizationTransformer;
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      userTransformer?: UserTransformer;
      groupTransformer?: GroupTransformer;
      organizationTransformer?: OrganizationTransformer;
    },
  ): MicrosoftGraphOrgReaderProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec,
    _optional: boolean,
    emit: CatalogProcessorEmit,
  ): Promise<boolean>;
}

// @public
export type MicrosoftGraphProviderConfig = {
  id: string;
  target: string;
  authority?: string;
  tenantId: string;
  clientId?: string;
  clientSecret?: string;
  userFilter?: string;
  userSelect?: string[];
  userExpand?: string;
  userGroupMemberFilter?: string;
  userGroupMemberSearch?: string;
  groupExpand?: string;
  groupFilter?: string;
  groupSearch?: string;
  groupSelect?: string[];
  queryMode?: 'basic' | 'advanced';
  schedule?: TaskScheduleDefinition;
};

// @public
export function normalizeEntityName(name: string): string;

// @public
export type ODataQuery = {
  search?: string;
  filter?: string;
  expand?: string;
  select?: string[];
  count?: boolean;
  top?: number;
};

// @public
export type OrganizationTransformer = (
  organization: MicrosoftGraph.Organization,
) => Promise<GroupEntity | undefined>;

// @public @deprecated
export function readMicrosoftGraphConfig(
  config: Config,
): MicrosoftGraphProviderConfig[];

// @public
export function readMicrosoftGraphOrg(
  client: MicrosoftGraphClient,
  tenantId: string,
  options: {
    userExpand?: string;
    userFilter?: string;
    userSelect?: string[];
    userGroupMemberSearch?: string;
    userGroupMemberFilter?: string;
    groupExpand?: string;
    groupSearch?: string;
    groupFilter?: string;
    groupSelect?: string[];
    queryMode?: 'basic' | 'advanced';
    userTransformer?: UserTransformer;
    groupTransformer?: GroupTransformer;
    organizationTransformer?: OrganizationTransformer;
    logger: Logger;
  },
): Promise<{
  users: UserEntity[];
  groups: GroupEntity[];
}>;

// @public
export function readProviderConfig(
  id: string,
  config: Config,
): MicrosoftGraphProviderConfig;

// @public
export function readProviderConfigs(
  config: Config,
): MicrosoftGraphProviderConfig[];

// @public
export type UserTransformer = (
  user: MicrosoftGraph.User,
  userPhoto?: string,
) => Promise<UserEntity | undefined>;
```
